<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>升腾客户管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/X-admin/css/font.css">
    <link rel="stylesheet" href="/X-admin/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/X-admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/X-admin/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">会员审核</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so layui-form-pane">
          <input class="layui-input" placeholder="输入手机号" name="mobile">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon"></i>查询</button>
        </form>
      </div>
	  {notempty name="member"}
        <form class="layui-form" action ="{:url('Admin/member/auditUpdate')}" method="post" id="myform">
		<input type="hidden" name="mid" value="{$member.mid}">
          <div class="layui-form-item">
		  <input type="hidden" name="id" value="{$member.mid}">
              <label for="name" class="layui-form-label">
                  <span class="x-red">*</span>真实姓名
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="name" name="real_name" required="" lay-verify="required"
                  autocomplete="off" value="{$member.real_name}" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="referee_name" class="layui-form-label">
                  推荐人
              </label>
              <div class="layui-input-inline">
                  <input type="referee_name" id="referee_name" name="referee_name" lay-verify="required" value="{$member.referee_name}" disabled
                  autocomplete="off" class="layui-input">
              </div>
          </div>
		  
          <div class="layui-form-item">
              <label for="id_card" class="layui-form-label">
                  身份证
              </label>
              <div class="layui-input-inline">
                  <input type="id_card" id="id_card" name="id_card" lay-verify="required" value="{$member.id_card}" disabled
                  autocomplete="off" class="layui-input">
              </div>
          </div>		  
          <div class="layui-form-item">
              <label for="referee_mobile" class="layui-form-label">
                  推荐人电话
              </label>
              <div class="layui-input-inline">
                  <input type="referee_mobile" id="referee_mobile" name="referee_mobile" lay-verify="required" value="{$member.referee_mobile}" disabled
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="mobile" class="layui-form-label">
                  <span class="x-red">*</span>手机
              </label>
              <div class="layui-input-inline">
                  <input type="text" id="mobile" name="mobile" required="" lay-verify="required" disabled
                  autocomplete="off" value="{$member.mobile}" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">
                  <span class="x-red">*</span>
              </div>
          </div>
          <div class="layui-form-item">
              <label for="address" class="layui-form-label">
                  地址
              </label>
              <div class="layui-input-inline">
                  <input type="address" id="address" name="address" value="{$member.address}" disabled
                  autocomplete="off" class="layui-input">
              </div>

          </div>
          <div class="layui-form-item">
              <label for="silver_card" class="layui-form-label">
                  数据代码
              </label>
              <div class="layui-input-inline">
                  <input type="silver_card" id="silver_card" name="silver_card" lay-verify="required" value="{$member.silver_card}" disabled
                  autocomplete="off" class="layui-input">
              </div>

          </div>
          <div class="layui-form-item">
              <label for="bank_name" class="layui-form-label">
                  开户行
              </label>
              <div class="layui-input-inline">
                  <input type="bank_name" id="bank_name" name="bank_name" value="{$member.bank_name}" disabled
                  autocomplete="off" class="layui-input">
              </div>

          </div>
          <div class="layui-form-item">
              <label for="bank_card" class="layui-form-label">
                  银行账户
              </label>
              <div class="layui-input-inline">
                  <input type="bank_card" id="bank_card" name="bank_card" value="{$member.bank_card}" disabled
                  autocomplete="off" class="layui-input">
              </div>

          </div>		  
          <div class="layui-form-item">
              <label for="repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="update" id="update" lay-submit="">
                  修改
              </button>
			  <button  class="layui-btn" lay-filter="audit" id="audit" lay-submit="">
                  审核通过
              </button>
			  <button  class="layui-btn" lay-filter="forbid" id="forbid" lay-submit="">
                  不通过
              </button>
          </div>
      </form>
	{/notempty}
    </div>
    <script>
$(function(){
    $("#update").click(function(){
        var newUrl = '{:url('Admin/member/auditUpdate')}';    //设置新提交地址
        $("#myform").attr('action',newUrl);    //通过jquery为action属性赋值
        $("#myform").submit();    //提交ID为myform的表单
    })
	
	$("#audit").click(function(){
        var newUrl = '{:url('Admin/member/auditPost')}';    //设置新提交地址
        $("#myform").attr('action',newUrl);    //通过jquery为action属性赋值
        $("#myform").submit();    //提交ID为myform的表单
    })
	$("#forbid").click(function(){
        var newUrl = '{:url('Admin/member/forbid')}';    //设置新提交地址
        $("#myform").attr('action',newUrl);    //通过jquery为action属性赋值
        $("#myform").submit();    //提交ID为myform的表单
    })
})
	
/*
  
          form.on('submit(audit)', function(data){
            //
            //发异步，把数据提交给php
			alert('asdasdf');
			  jQuery.ajax({  
				url: "{:url('Admin/member/auditPost')}",  
				type: "post",  
				dataType: "json",  
				async: true,  
				data: data.field,  
				success: function(data){  
					if(data.code){	
					
						layer.alert("审核成功", {icon: 6},function () {
							// 获得frame索引
							var index = parent.layer.getFrameIndex(window.name);
							//关闭当前frame
							parent.layer.close(index);
						});
					
					
					}else{
					console.log(data)
					
						layer.alert("审核失败："+data.msg, {icon: 6},function () {
							// 获得frame索引
							var index = parent.layer.getFrameIndex(window.name);
							//关闭当前frame
							parent.layer.close(index);
						});
					}
					
				},
				error: function (XMLHttpRequest, textStatus, errorThrown) {	
						layer.msg('执行时发生500错误！代码：'+textStatus+'请联系管理员！',{icon: 5,time:6000});
				}			
			});			
			
			

            return false;
          });	  
	  
          form.on('submit(update)', function(data){
            //console.log(data.field);
            //发异步，把数据提交给php
			alert('asdasdf');
			
			  jQuery.ajax({  
				url: "{:url('Admin/member/update')}",  
				type: "post",  
				dataType: "json",  
				async: true,  
				data: data.field,  
				success: function(data){  
					if(data.code){	
					
						layer.alert("审核成功", {icon: 6},function () {
							// 获得frame索引
							var index = parent.layer.getFrameIndex(window.name);
							//关闭当前frame
							parent.layer.close(index);
						});
					
					
					}else{
					console.log(data)
					
						layer.alert("审核失败："+data.msg, {icon: 6},function () {
							// 获得frame索引
							var index = parent.layer.getFrameIndex(window.name);
							//关闭当前frame
							parent.layer.close(index);
						});
					}
					
				},
				error: function (XMLHttpRequest, textStatus, errorThrown) {	
						layer.msg('执行时发生500错误！代码：'+textStatus+'请联系管理员！',{icon: 5,time:6000});
				}			
			});			
			
			

            return false;
          });
          form.on('submit(cancel)', function(data){
            //console.log(data.field);
            //发异步，把数据提交给php
			
			  jQuery.ajax({  
				url: "{:url('Admin/member/cancel')}",  
				type: "post",  
				dataType: "json",  
				async: true,  
				data: data.field,  
				success: function(data){  
					if(data.code){	
					
						layer.alert("审核成功", {icon: 6},function () {
							// 获得frame索引
							var index = parent.layer.getFrameIndex(window.name);
							//关闭当前frame
							parent.layer.close(index);
						});
					
					
					}else{
					console.log(data)
					
						layer.alert("审核失败："+data.msg, {icon: 6},function () {
							// 获得frame索引
							var index = parent.layer.getFrameIndex(window.name);
							//关闭当前frame
							parent.layer.close(index);
						});
					}
					
				},
				error: function (XMLHttpRequest, textStatus, errorThrown) {	
						layer.msg('执行时发生500错误！代码：'+textStatus+'请联系管理员！',{icon: 5,time:6000});
				}			
			});			
			
			

            return false;
          });
*/

    </script>
  </body>

</html>